Conversation
nwf-msr
left a comment
There was a problem hiding this comment.
Comments so far; posting before switching threads.
nwf-msr
left a comment
There was a problem hiding this comment.
Generally looks quite nice. ISTR snmalloc of old had the ability to conditionally keep stats or not; perhaps it would be worth having an empty implementation of the Stat and MonotoneStat interfaces and either templating or having a namespace snmalloc-scoped using to pick between them?
src/snmalloc/mem/globalalloc.h
Outdated
| } | ||
|
|
||
| if ( | ||
| result == nullptr && RemoteDeallocCache::remote_inflight.get_curr() != 0) |
There was a problem hiding this comment.
Something has happened (TM) with the syntax there. Can this be a SNMALLOC_ASSERT_MSG?
nwf-msr
left a comment
There was a problem hiding this comment.
Generally looks quite nice. ISTR snmalloc of old had the ability to conditionally keep stats or not; perhaps it would be worth having an empty implementation of the Stat and MonotoneStat interfaces and either templating or having a namespace snmalloc-scoped using to pick between them?
I was going to profile to see how much the operations cost. If they are noticeable, then I will macro it away as you suggest. |
This adds a collection of per sizeclass statistic for tracking how many allocations have occurred on each thread. These are racily combined to provide basic tracking information.
f576431 to
bfc415a
Compare
|
So I have benchmarked this, and it has a perf regression. The worst case seems to be 3% (glibc-thread), but most tests are below 1%. I am going to investigate moving more of the statistics off the fast path. This will basically be,
This will over approximate the current user allocations quite a bit, but should make the overhead practically zero. Alternatively, we could look at making this a compile time option. |
This adds some statistic for tracking
The per sizeclass statistics are tracked per allocator, and a racy read is done to combine the results for displaying.
These statistics were used to debug #615 to calculate the fragmentation.
The displayed statistics are intended for post processing to calculate the fragmentation/utilisation.
The interface just prints the results using
message. This could be improved with a better logging infrastructure.